<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/comm/comm.jsp" %>
<html>
<body>
 <div id="blayout" class="easyui-layout" style="width:100%;height:100%;">
        <div data-options="region:'north'" style="height:50px">
			<span style="float:right;font-size:24px;"><a href="#" onclick="loginout()">退出</a></span>
        </div>
        <div data-options="region:'south',split:true" title='老白' style="height:50px;">
        <a href="#" onclick="getCenterPanel()">获取底部面板</a>
        </div>
        <!-- <div data-options="region:'east',split:true" title="East" style="width:100px;">1</div> -->
        <div data-options="region:'west',split:true" title="West" style="width:200px;">
          <div class="easyui-accordion" style="width:100%;height:auto;">
        <div title="学习" data-options="iconCls:'icon-ok'" style="overflow:auto;padding:10px;">
	        <a href="helloworld.action">HELLO WORLD!!</a><br>
			<a href="helloworld2!error.action">HELLO WORLD2!!</a><br>
			<a href="helloworld2!upload.action">上传测试</a><br>
			<a href="#"  class="easyui-linkbutton" onclick="test2()">EASYUISHOW测试</a><br>
			<a href="#" class="easyui-linkbutton" onclick="test()">JSON测试</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="addTab('上传测试','helloworld2!upload.action')">上传测试</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="dialogopen()">开启对话框</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="addTab('baidu','http://www.baidu.com')">百度</a>  <br>
			<a href="#" class="easyui-linkbutton" onclick="addTab('HELLO WORLD!!','helloworld.do')">HELLO WORLD!!</a>  <br>
			<a href="#" class="easyui-linkbutton" onclick="addTab('添加用户','mUserAction!initAddUser.do')">添加用户</a>  <br>
			<a href="#" class="easyui-linkbutton" onclick="addTab('添加用户2','mUserAction!initAddUser2.do')">添加用户2</a>  <br>
			<a href="#" class="easyui-linkbutton" onclick="addTab('用户管理','mUserAction!initUsers.do')">用户管理</a>  <br>
        </div>
        <div title="学习2" data-options="iconCls:'icon-bgt'" style="overflow:auto;padding:10px;">
	        <a href="helloworld.action">HELLO WORLD!!</a><br>
			<a href="helloworld2!error.action">HELLO WORLD2!!</a><br>
			<a href="helloworld2!upload.action">上传测试</a><br>
			<a href="#" class="easyui-linkbutton" onclick="test()">JSON测试</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="addTab('上传测试','helloworld2!upload.action')">上传测试</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="dialogopen()">开启对话框</a>  <br>  
			<a href="#" class="easyui-linkbutton" onclick="addTab('baidu','http://www.baidu.com')">百度</a>  <br>
			<a href="#" class="easyui-linkbutton" onclick="addTab('HELLO WORLD!!','helloworld.do')">HELLO WORLD!!</a>  <br>
        </div>
        <div title="Help" data-options="iconCls:'icon-help',href:'helloworld2!error.action'" style="padding:10px;">
        </div>
    </div>
		</div>
        <div data-options="region:'center',title:'首页',iconCls:'icon-ok'">
           <div id="tt" class="easyui-tabs" style="width:100%;height:100%;" border="false" fit="true">    
			    <div title="Home" data-options="href:'helloworld.do'">  
			    <!-- 
			     <div id="p" class="easyui-panel" title="My Panel"     
				        style="width:500px;height:150px;padding:10px;background:#fafafa;"   
				        data-options="iconCls:'icon-save',closable:true">   
				        <%--,collapsible:true,minimizable:true,maximizable:true  祛除折叠 最小最大化--%>
				    <p>panel content.</p>   
				    <p>panel content.</p>   
				</div>  
			     -->
			    </div>    
			</div>   
        </div>
    </div>
    <div id="dd2" title="对话框"  
				        data-options="iconCls:'icon-save'">   
				</div>   
<script type="text/javascript">
function test2(){
	$.messager.show({
		title:"提示",
		msg:"我是提示信息"
	});
}
function test(){
	 $.ajax({
 		url: 'userAction!json.action',
 		type: 'post',
 		dataType: 'json',
 		data: {
 		   "name":"bgt",
 		   "pwd":"bpwd"
 		},
 		success: function (data) {
 			//json格式转换的两种方式
 			//var dds=eval("("+data.dataMap+")");
 			//$.parseJSON(data);
 			$.messager.alert('警告',data.dataMap.lists[0].name);   
 			console.info(data);
 		}
 });
}
function addTab(title, url){    
    if ($('#tt').tabs('exists', title)){    
        $('#tt').tabs('select', title);    
    } else {    
        var content = '<iframe scrolling="auto" frameborder="0"  src="'+url+'" style="width:100%;height:100%;"></iframe>';    
        $('#tt').tabs('add',{    
            title:title,    
            content:content,    
            closable:true    
        });    
    }    
}   
function dialogopen(){
	/**
	easyloader.load("dialog",function(){
		$("#dd2").dialog({
			left:"40%",
			top:"40%",
			modal:true
		});
	});
	*/
	$("#dd2").dialog({
		left:"40%",
		top:"40%",
		width:400,
		height:200,
		href:"userAction!json.action",
		modal:true
	});
}
function loginout(){
	 $.ajax({
	 		url: 'mUserAction!loginout.action',
	 		type: 'post',
	 		dataType: 'json',
	 		data: {
	 		},
	 		success: function (datas) {
	 			$.messager.alert('警告',datas.msg);   
	 			console.info(datas);
	 			window.location.href="";
	 		}
	 });
}
function getCenterPanel(){
	var centerpanel=$('#blayout').layout('panel','south');
	console.info(centerpanel.panel('options').title);
}
</script>
</body>
</html>
